package Dmusic.galaxy;


import java.util.ArrayList;

import Dmusic.galaxy.R.menu;
import android.app.Activity;
import android.view.*;
import android.os.Bundle;
import android.os.Environment;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Toast;


public class DmusicActivity extends Activity {
    /** Called when the activity is first created. */
   
   
    ListView listView;
	ListAdapter adapter;
	ArrayList<Item> ListItem;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list);
        String sdPath = Environment.getExternalStorageDirectory() +"";
        String ingPath = sdPath +"\\"+"images.jpeg";
        ListItem = new ArrayList<Item>();
        ListItem.add(new Item (ingPath, " image"));
        ListItem.add(new Item (ingPath, " image"));
        ListItem.add(new Item (ingPath, " image"));
        ListItem.add(new Item (ingPath, " image"));
        ListItem.add(new Item (ingPath, " image"));
        ListItem.add(new Item (ingPath, " image"));
        
        adapter = new listAdapter(getApplicationContext(),ListItem);
       		
       listView = (ListView)findViewById(R.id.listView1);
       
       listView.setAdapter(adapter);
    }
    public boolean onCreateOptionsMenu(Menu menu)
    {
    	MenuInflater menuInflater = getMenuInflater();
    	menuInflater.inflate(R.menu.menu, menu);
    	return true;
}
    public boolean onOptionsItemSelected(MenuItem item)
    		{
    	switch (item.getItemId())
    		        {
    	        case R.id.menu_bookmark:
    	           
    	            Toast.makeText(DmusicActivity.this, "Bookmark is Selected", Toast.LENGTH_SHORT).show();
    	            return true;
    	        default:
    	                 return super.onOptionsItemSelected(item);
    		        }
    }
    
    
}
      
